/*
 *      Copyright 2008 Battams, Derek
 *       
 *       Licensed under the Apache License, Version 2.0 (the "License");
 *       you may not use this file except in compliance with the License.
 *       You may obtain a copy of the License at
 *
 *          http://www.apache.org/licenses/LICENSE-2.0
 *
 *       Unless required by applicable law or agreed to in writing, software
 *       distributed under the License is distributed on an "AS IS" BASIS,
 *       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *       See the License for the specific language governing permissions and
 *       limitations under the License.
 */
package com.google.code.gwtsrwc.client;

/**
 * A ColumnDescriptor is used to describe details about a column in a LiveFlexTable
 * @author $Author: derek@battams.ca $
 * @version $Id: ColumnDescriptor.java 11 2008-09-04 00:43:06Z derek@battams.ca $
 * $URL: http://gwtsrwc.googlecode.com/svn/trunk/src/com/google/code/gwtsrwc/client/ColumnDescriptor.java $
 */
public class ColumnDescriptor {
	private String id;
	private String heading;
	private boolean isSortable;
	
	/**
	 * Constructor
	 * @param id The id used to uniquely identify this column in the LiveFlexTable to which it is attached
	 * @param heading The proper heading to display in the table, when the heading display is enabled
	 * @param isSortable Can this column be sorted?
	 */
	public ColumnDescriptor(String id, String heading, boolean isSortable) {
		this.id = id;
		this.heading = heading;
		this.isSortable = isSortable;
	}
	
	/**
	 * Constructor; sets heading to null and isSortable to false
	 * @param id The unique identifier for ths column in the LiveFlexTable
	 */
	public ColumnDescriptor(String id) {
		this.id = id;
		heading = null;
		isSortable = false;
	}
	
	/**
	 * Set the heading of this column
	 * @param heading The heading to use for the column
	 */
	public void setHeading(String heading) {
		this.heading = heading;
		return;
	}
	
	/**
	 * Set the sortable flag for this column
	 * @param isSortable
	 */
	public void setIsSortable(boolean isSortable) {
		this.isSortable = isSortable;
		return;
	}
	
	/**
	 * Get the unique id for this column
	 * @return The unique id
	 */
	public String getId() {
		return id;
	}
	
	/**
	 * Get the proper display heading set for this column
	 * @return The heading string
	 */
	public String getHeading() {
		return heading;
	}
	
	/**
	 * Get the value of the sortable flag for this column
	 * @return The sortable flag value
	 */
	public boolean getIsSortable() {
		return isSortable;
	}
}